#ifndef __QUAD_TREE_OCCUPANT_HANDLER_HPP__
#define __QUAD_TREE_OCCUPANT_HANDLER_HPP__

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include "../BaseObjectHandler.hpp"

class QuadTreeOccupantHandler : public BaseObjectHandler
{
public:
    ////////////////////////////////////////////////////////////
    /// Constructor
    ///
    ////////////////////////////////////////////////////////////
                            QuadTreeOccupantHandler();
    ////////////////////////////////////////////////////////////
    /// Copy Constructor
    ///
    /// \param _Copy :      Handler to copy from
    ///
    ////////////////////////////////////////////////////////////
                            QuadTreeOccupantHandler( const QuadTreeOccupantHandler& _Copy );
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from properties
    /// BaseObjectHandler::InitFromGrid need to be called AFTER the specialized class
    ///
    /// \param _pPropertyGrid :      Grid where infos are stored
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromGrid( wxPropertyGrid* _pPropertyGrid );
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from an XMLElement
    /// BaseObjectHandler::InitFromXML need to be called AFTER the specialized class
    ///
    /// \param _pElement :           XML Element with info
    /// \param _ProjectPath :        Path to the project
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromXML( tinyxml2::XMLElement* _pElement, const wxString& _ProjectPath );
    
    ////////////////////////////////////////////////////////////
    /// Return the value of a property
    ///
    /// \param _PropertyName :      Name of the property
    ///
    /// \return The value as a string
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        GetValueAsString( const wxString& _PropertyName ) const;
    
    ////////////////////////////////////////////////////////////
    /// Handle the change of a property and apply it to the object
    ///
    /// \param _pPropertyGrid :      The property grid
    /// \param _pChangedProperty :   Property that has been changed
    ///
    /// \return Whether the object has been changed or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            OnPropertyChanged( wxPropertyGrid* _pPropertyGrid, wxPGProperty* _pChangedProperty );

protected:
    ////////////////////////////////////////////////////////////
    /// Create an XML string with the value of the object
    ///
    /// \param _ProjectPath :   Path to the project
    /// \param _Tab :           Tab string to have a beautiful XML
    ///
    /// \return the XML String
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        InnerXMLString( const wxString& _ProjectPath = wxEmptyString, const wxString& _Tab = wxT( "\t" ) ) const;
};

#endif // __QUAD_TREE_OCCUPANT_HANDLER_HPP__